<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
// import Joomla view library
jimport('joomla.application.component.view');
 
/**
 * HTML View class for the HelloWorld Component
 */
class ShopViewDetail extends JView
{
	protected $item = null;
	protected $path_img = null;
	// Overwriting JView display method
	function display($tpl = null) 
	{
		$app = JFactory::getApplication();
		$this->path_img = JURI::root().'images/image_product/';
		$id = JRequest::getVar('id');
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select('*');
		$query->from("#__shop_product");
		$query->where("id = $id");
		$db->setQuery((string)$query);
		$this->item = $db->loadObject();
		
		// Check for errors.
		if (count($errors = $this->get('Errors'))) 
		{
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		}
	
		// Display the view
		parent::display($tpl);
	}
	
	
}